package com.cn.jx;


import javax.servlet.ServletContext;
import javax.servlet.ServletException;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;

/**
 * <p>ManagerApplication  系统启动入口
 * <p> 实现<{@link SpringBootServletInitializer SpringBootServletInitializer}
 * 
 * @author <h1>jiangxu2  2019年11月21日</h1>
 * @version v1.11.20.2019
 * @since 1.0
 * 
 * @see #onStartup(ServletContext)
 * @see #createSpringApplicationBuilder()
 * @see #main(String[])
 */
@SpringBootApplication(exclude={
		ThymeleafAutoConfiguration.class
})
@ComponentScan(basePackages={
		"com.cn.jx"
})
@EnableCaching
public class ManagerApplication extends SpringBootServletInitializer {

	@Override
	public void onStartup(ServletContext servletContext) throws ServletException {
		servletContext.setInitParameter("appName","management");
        super.onStartup(servletContext);
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(ManagerApplication.class);
	}
	 
	public static void main(String[] args) {
		SpringApplication.run(ManagerApplication.class, args);
	}
}
